<template>
  <div class='xiang'>
    <header>
      <div>
        <router-link tag='button' to='/'>
          ＜
        </router-link>
      </div>
      <div>{{banner.sub_tit}}</div>
      <div>···</div>
    </header>
    <section>
      <div class='picture'>
        <img :src="banner.imgarr" alt="">
        <span>成品图{{ls}}</span>
      </div>
      <div class='ne'>{{banner.sub_tit}}</div>
      <div class='auo'>
        <img :src="banner.author_src" alt="">
            </div>
        <div class='aun'>{{banner.author_name}}</div>
        <div class='aus'>0收藏</div>
        <div class='aut'>
          <div class='aut-1' v-for='(item,index) in t' :key='index'>
            <img  :src="item[1]" alt="">
            <p>{{item[0]}}</p>
          </div>
        </div>
        <div class='list'>材料 </div>
        <div v-for='(demo,index) in s' :key='index' class='li'>
          <div class='li-1'>{{demo[0]}}</div>
          <div class='li-2'>{{demo[1]}}
            <img src="../../shouye/lg.png" alt="">
          </div>
          </div>

    </section>
    <footer></footer>
  </div>
</template>
<script>
import axios from "axios";
export default {
  data() {
    return {
      banner: {},
      id: "",
      ls: "",
      t: [],
      s: []
    };
  },
  created() {
    this.id = this.$route.params.ID;
    axios.get("api/menu/menuList").then(res => {
      res.data.map(i => {
        if (this.id == i.ID) {
          this.banner = i;
          let b = this.banner.imgarr.split(";");
          this.ls = b.length;
          let b2 = b.splice(0, 1).join("");
          this.banner.imgarr = b2;
          let a = this.banner.demand_json.split("&");
          a.map(j => {
            this.t.push(j.split("="));
          });
          let c = this.banner.list_materia.split("&");
          c.map(t => {
            this.s.push(t.split("="));
          });
        }
      });
    });
  }
};
</script>
<style scoped lang='scss'>
.xiang {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  width: 100%;
  height: calc(153rem / 67.5);
  background: #ff6668;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  div:nth-child(1) {
    button {
      outline: none;
      border: none;
      background: none;
      font-size: 24px;
      color: white;
    }
  }
  div:nth-child(2) {
    font-size: calc(63rem / 67.5);
  }
  div:nth-child(3) {
    font-size: 26px;
    font-weight: bold;
    display: flex;
    align-items: center;
    margin-right: calc(30rem / 67.5);
  }
}
section {
  flex: 1;
  overflow: auto;
  .picture {
    height: calc(1086rem / 67.5);
    width: 100%;
    position: relative;
    img {
      width: 100%;
      height: 100%;
    }
    span {
      width: calc(240rem / 67.5);
      height: calc(54rem / 67.5);
      line-height: calc(54rem / 67.5);
      position: absolute;
      bottom: calc(36rem / 67.5);
      background: rgba(67, 68, 70, 0.6);
      border-radius: 10px;
      font-size: calc(33rem / 67.5);
      left: calc(50% - 240rem / 67.5 / 2);
      text-align: center;
      color: white;
      border: 1px solid white;
    }
  }
  .ne {
    width: 100%;
    height: calc(145rem / 67.5);
    text-align: center;
    line-height: calc(145rem / 67.5);
    font-size: calc(70rem / 67.5);
    color: 121212;
  }
  .auo {
    width: 100%;
    height: calc(162rem / 67.5);
    text-align: center;
    line-height: calc(162rem / 67.5);
    img {
      width: calc(121rem / 67.5);
      height: calc(121rem / 67.5);
      border-radius: 50%;
    }
  }
  .aun {
    width: 100%;
    text-align: center;
    font-size: calc(36rem / 67.5);
  }
  .aus {
    width: 100%;
    height: calc(93rem / 67.5);
    font-size: calc(27rem / 67.5);
    color: #969696;
    text-align: center;
    line-height: calc(93rem / 67.5);
  }
  .aut {
    width: calc(595rem / 67.5);
    height: calc(144rem / 67.5);
    margin: 0 auto;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    .aut-1 {
      width: calc(105rem / 67.5);
      height: calc(140rem / 67.5);
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      img {
        width: calc(62rem / 67.5);
        height: calc(62rem / 67.5);
        display: block;
      }
      p {
        font-size: calc(32rem / 67.5);
      }
    }
  }
  .list {
    width: 95%;
    height: calc(95rem / 67.5);
    float: right;
    border-bottom: 1px solid #dcdcdc;
    font-size: clac(43rem / 67.5);
    color: #646464;
    line-height: calc(95rem / 67.5);
    margin-top: 15px;
  }
  .li {
    width: 95%;
    height: calc(134rem / 67.5);
    display: flex;
    justify-content: space-between;
    float: right;
    line-height: calc(134rem / 67.5);
    border-bottom: 1px solid #dcdcdc;
    font-size: clac(61rem / 67.5);
    .li-1 {
      flex: 1;
    }
    .li-2 {
      flex: 1;
      color: #595959;
      position: relative;
      img {
        width: calc(30rem / 67.5);
        height: calc(41rem / 67.5);
        position: absolute;
        right: 10px;
        top: calc(41rem / 67.5);
      }
    }
  }
}
footer {
  width: 100%;
  height: calc(153rem / 67.5);
  background: #ff6668;
}
</style>

